<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        width: 50px;
        height: 50px;
        /* background: violet; */
        position: absolute;
        /* border-radius: 50%; */
        font-size: 50px;
        color: violet;
        transform: translate(-18px, -30px);
      }
    </style>
  </head>
  <body>
    <div class="box">☆</div>
    <script>
      var boxEle = document.querySelector(".box");

      document.documentElement.onmousemove = function () {
        // boxEle.innerHTML = `${event.pageX}${event.pageY}`;
        boxEle.style.top = `${event.pageY}px`;
        boxEle.style.left = `${event.pageX}px`;
      };
    </script>
  </body>
</html>
